<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>分类</title>
    <link rel="stylesheet" type="text/css" href="CSS/all.css"  th:href="@{/CSS/all.css}"/>
    <link rel="stylesheet" type="text/css" href="CSS/fl.css"  th:href="@{/CSS/fl.css}" />
    <script th:src="@{/JS/jquery.js}"></script>
    
</head>
<body>
        <header>分类</header>
        <div class="title">
            <a th:href="@{/Story/getAllCategoryStoryList(isLogin='')}" >首页</a>
            <a th:href="@{/Category/getBookByCategoryId(CategoryId=0)}" class="activetitle">分类</a>
            <a th:href="@{/Store/getTotalPage(index=5)}">排行</a>
            <a th:href="@{/Story/getStoryEndPage(status='已完结')}">全本</a>
            <a th:href="@{/Store/getUserInfo}">会员中心</a>
            
        </div>
        <div class="searchinput">
            <input class="searchBook" type="text" placeholder="请输入书名或作者" />
            <button  class="search"><svg class="icon" style="width: 1.5rem; height: 1.5rem;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1128"><path d="M963.80969 874.914509 746.640896 653.056614c-3.587891-3.66551-7.710925-6.443725-12.110336-8.352256 46.655488-62.60183 74.359501-140.751667 74.359501-225.526477 0-205.788877-163.237376-372.568371-364.609741-372.568371C242.909082 46.60951 79.67785 213.390029 79.67785 419.177984c0 205.792973 163.231232 372.569395 364.603597 372.569395 92.421632 0 176.807936-35.134157 241.069056-93.044122 1.778586 3.55799 4.115866 6.89705 7.027302 9.871872l217.115546 221.85687c14.970573 15.300506 39.292518 15.300506 54.316237 0C978.780262 915.131494 978.780262 890.21399 963.80969 874.914509zM444.281446 732.950221c-169.564672 0-307.06176-140.4928-307.06176-313.772237 0-173.332685 137.496064-313.766195 307.06176-313.766195 169.570816 0 307.06176 140.433408 307.06176 313.766195C751.343206 592.457421 613.851238 732.950221 444.281446 732.950221z" p-id="1129"></path></svg></button>
        </div>
        <main>
            <div class="kind" >
                <a  th:each="cate : ${CategoryBook['categort']}"  th:href="@{/Category/getBookByCategoryId(CategoryId=${cate.id})}" th:text="${cate.name}"></a>
            </div>
            <div th:if="${CategoryBook['objs'].size()<=0}" style="text-align:center;margin-top: 30px;">暂无数据</div>
            <ul  th:each="objs : ${CategoryBook['objs']}">
                <li ><span class="" th:each="category : ${CategoryBook['category']}" th:text="${category.name}"></span><a href="" th:href="@{/Chapter/getChapterByBookId(bookId=${objs.id})}" th:text="${objs.name}"></a><span th:text="${objs.author}">猫老大的道</span></li>
            </ul>
            <div class="fycontrol" th:if="${CategoryBook['objs'].size()>0}">
                <div class="fenye">
                    <a  th:if="${CategoryBook['currentPage']>1}" th:href="@{/Category/getBookByCategoryId(CategoryId=${CategoryId},page=0)}">首页</a>
                    <a th:if="${CategoryBook['currentPage']>1}" th:href="@{/Category/getBookByCategoryId(CategoryId=${CategoryId},page=${CategoryBook['currentPage']-1})}">上一页</a>
                    <a th:if="${CategoryBook['currentPage']<CategoryBook['total']}" th:href="@{/Category/getBookByCategoryId(CategoryId=${CategoryId},page=${CategoryBook['currentPage']}==${CategoryBook['total']}?${CategoryBook['total']}:${CategoryBook['currentPage']+1})}">下一页</a>
                    <a th:if="${CategoryBook['currentPage']<CategoryBook['total']}" th:href="@{/Category/getBookByCategoryId(CategoryId=${CategoryId},page=${CategoryBook['total']})}">尾页</a>
                </div>
                <div class="yema">第<span>[[${CategoryBook['currentPage']}]]/[[${CategoryBook['total']}]]</span>页<input class="tz" type="text" /><button>跳转</button></div>
             </div>
        </main>
        <footer>
                本站所有小说为转载作品，所有章节均由网友上传，转载至本站只是为了宣传本书让更多读者欣赏。
        </footer>
</body>
<script  th:inline="javascript">
    var message = [[${CategoryId}]];
    console.log(message);
    if (message>0){
        $(".kind a").eq(message-1).addClass("activea")
    }

    $(".yema>button").click(function () {
        var page = $(".tz").val();
        var total = [[${CategoryBook['total']}]];
        if (total==null){
            total=0;
        }
        if (page==null){
            page=1;
        }
        location.href='/Category/getBookByCategoryId?CategoryId='+message+'&page='+(page>total?total:page);;
    })
    $('button.search').click(function(){
        var nameOrAuthor = $(".searchBook").val();
        console.log(nameOrAuthor);
        location.href='/Story/getStoryList?nameOrAuthor='+nameOrAuthor;
    })
</script>
</html>
